Add proxy support for pypi package managers#150
Conversation
SafeDep Report SummaryPackage Details
This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
==========================================
+ Coverage 37.77% 38.17% +0.40%
==========================================
Files 84 86 +2
Lines 5120 5336 +216
==========================================
+ Hits 1934 2037 +103
- Misses 3009 3114 +105
- Partials 177 185 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds proxy-based interception and malware analysis support for the Python (PyPI) ecosystem, aligning pip/uv/poetry behavior with the existing npm proxy flow.
Changes:
- Introduces PyPI-specific URL parsing for files.pythonhosted.org and pypi.org (Simple and JSON APIs), including robust filename parsing for wheels and source distributions.
- Adds a PyPI registry interceptor and hooks it into the proxy interceptor factory and proxy flow, and wires pip/pip3/poetry/uv commands to use ProxyFlow when proxy mode is enabled.
- Updates proxy mode documentation to mark
pip,uv, andpoetryas fully supported.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
proxy/interceptors/pypi_url_parser_test.go |
Provides comprehensive tests for PyPI URL parsing, filename parsing, name normalization, and registry hostname resolution. |
proxy/interceptors/pypi_url_parser.go |
Implements PyPI URL parsers and helpers for extracting package name/version and file type from registry URLs and filenames. |
proxy/interceptors/pypi_registry.go |
Defines PyPI registry endpoints and the PypiRegistryInterceptor that drives malware analysis for PyPI downloads via the proxy. |
proxy/interceptors/factory.go |
Registers the PyPI interceptor and includes PyPI in the set of ecosystems supported by proxy-based interception. |
docs/proxy-mode.md |
Updates documentation to indicate proxy-mode support for pip, uv, and poetry. |
cmd/pypi/uv.go |
Switches uv to use common vs. proxy flow based on IsProxyModeEnabled, mirroring npm behavior. |
cmd/pypi/poetry.go |
Switches poetry to use common vs. proxy flow based on IsProxyModeEnabled. |
cmd/pypi/pip3.go |
Switches pip3 to use common vs. proxy flow based on IsProxyModeEnabled. |
cmd/pypi/pip.go |
Switches pip to use common vs. proxy flow based on IsProxyModeEnabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a885dd2 to
6e098be
Compare
vet Summary ReportThis report is generated by vet Policy Checks
Malicious Package AnalysisMalicious package analysis was performed using SafeDep Cloud API Malicious Package Analysis Report
Changed PackagesChanged Packages
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Closes #139